/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pig.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pig4cloud.pig.admin.api.entity.SysPost;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 岗位信息数据访问层接口
 * <p>
 * 提供岗位数据的持久化操作，包括岗位与用户的关联查询。
 * 继承MyBatis Plus的BaseMapper，拥有基本的CRUD功能
 * </p>
 *
 * @author lengleng
 * @date 2025/06/27
 */
@Mapper
public interface SysPostMapper extends BaseMapper<SysPost> {

	/**
	 * 通过用户ID查询岗位信息
	 * <p>
	 * 关联查询用户所属的所有岗位，通过用户岗位关联表进行查询。
	 * 用于展示用户的职位信息和组织架构定位
	 * </p>
	 * 
	 * @param userId 用户ID
	 * @return 用户所属的岗位信息列表
	 */
	List<SysPost> listPostsByUserId(Long userId);

}
